#ifndef HAND_REGION_H_
#define HAND_REGION_H_

// INCLUDES //
#include "region.h"
#include "puzzle_region.h"
#include "player_region.h"
#include "card/card.h"
//////////////

// CONSTANTS //
#define MAX_HAND_SIZE		6
#define CARD_SPACING		5
#define CARD_SELECT_INDENT	20
///////////////

/**
* A region that represents the player's hand.
* 
* @author dfoelber
**/
class HandRegion : public Region
{
public:
	/**
	* Constructor
	**/
	HandRegion();
	
	/**
	* Destructor
	**/
	virtual ~HandRegion();
	
	/**
	* Adds a card to the hand region.
	* 
	* @param card The card to add
	* @return Success
	**/
	//bool AddCard( Card* card );
	
	/**
	* Activates the selected card, removing if it selections are also destroyed.
	* 
	* @return Success
	**/
	bool ActivateCard();
	
	/**
	* Notify the region of an event.
	* 
	* Overridden from Region.
	* 
	* @param event The event that happened
	* @return If the region used the event
	**/
	virtual bool ProcessEvent( SDL_Event event );
	
	/**
	* Notifies of time passing.
	* 
	* Overridden from Region.
	* 
	* @param The amount of time, in milliseconds, that passed since the last call
	**/
	virtual void TimePassed( int ms );
	
	/**
	* Renders the objects on the background
	* 
	* Overridden from Region.
	**/
	virtual void Render();
	
	/**
	* Pointer to the puzzle region.
	**/
	void SetPuzzleRegion(PuzzleRegion* region) { puzzleRegion = region; }
	
	/**
	* Pointer to the player region.
	**/
	void SetPlayerRegion(PlayerRegion* region) { playerRegion = region; }
	
	/**
	* Attempts to fill the hand with cards.
	**/
	void GrabCards();
	
private:
	/**
	* Handles the selected card.
	* 
	* @param index The card index to set selected
	**/
	void OnCardSelection(int index);
	
private:
	/// The queue of cards to be animated
	vector<Card*>		cardQueue;
	/// The animating card
	Card*				animatingCard;
	/// The selected card
	Object*				selectedCard;
	/// Puzzle region delegate
	PuzzleRegion*		puzzleRegion;
	/// Player region delegate
	PlayerRegion*		playerRegion;
};

#endif /*HAND_REGION_H_*/
